package cap3;

public class Linea {

	//Atributos de Instancia
	private String nro; 
	private Plan plan ;

	private int consumosSMS;
	private int consumosAComunidad;
	private int consumosAMoviles;
	//Constructor
	public Linea (String n){
	 nro = n;}
	//Comandos
	public void establecerPlan (Plan p){
	  plan = p;}
	public void aumentarSMS (int n){
	 consumosSMS=+ n;}
	public void aumentarAComunidad (int n){
	 consumosSMS=+ n;}
	public void aumentarAMoviles (int n){
	 consumosSMS=+ n;}
	//Consultas
	public String obtenerNro (){
	 return nro ;}
	public Plan obtenerPlan(){
	  return plan;}
	public int obtenerConsumosSMS (){
	 return consumosSMS ;}
	public int obtenerConsumosAComunidad (){
	 return consumosAComunidad ;}
	public int obtenerConsumosAMoviles (){
	 return consumosAMoviles ;}
	public int consumoCredito(){
	  return consumosAComunidad+consumosAMoviles*2;}
	public int smsDisponibles(){
	//Requiere el plan ligado
	  return plan.obtenerSMS()-consumosSMS;}
	public int creditoDisponible(){
	//Requiere el plan ligado
	  return plan.obtenerCredito()-consumoCredito();}
	} 
